			<script>
				function addRole(){
					$.ajax({
						url: "<?= base_url(); ?>role/add_role",
						type: "POST",
						data: "nama_role="+$("#nama-role").val(),
						success: function(msg){
							window.location = "<?= base_url(); ?>role";
						}
					});
				}
				
				function deleteRole(id){
					$.ajax({
						url: "<?= base_url(); ?>role/delete_role",
						type: "POST",
						data: "id_role="+id,
						success: function(msg){
							window.location = "<?= base_url(); ?>role";
						}
					});
				}
				
				function updateRole(id){
					$.ajax({
						url: "<?= base_url(); ?>role/update_role",
						type: "POST",
						data: "id_role="+id,
						success: function(msg){
							//$('#role-edit').html(msg);
							if(msg == "" || msg == null){
								
							} else {
								$('#role-edit').html(msg);
							}
						}
					});
				}
				
				function submitRole(id){
					$.ajax({
						url: "<?= base_url(); ?>role/submit_role",
						type: "POST",
						data: "id_role="+id+"&nama_role="+$("#nama-role").val(),
						success: function(msg){
							//$('#role-edit').html(msg);
							if(msg == "" || msg == null){
								
							} else {
								window.location = "<?= base_url(); ?>role";
							}
						}
					});
				}
				
				function updateHakAkses(id){
					$.ajax({
						url: "<?= base_url(); ?>role/update_hak_akses",
						type: "POST",
						data: "id_role="+id,
						success: function(msg){
							$('#hak-akses-list').html(msg);
						}
					});
				}
				
				
			</script>
			
			<div id="role-edit">
			<?php $this->load->view('role/role_edit', array('NEW' => TRUE)); ?>
			</div></div></div>
			
			<div id="role-list">
				<div class="row-fluid sortable">		
					<div class="box span12">
						<div class="box-header well" data-original-title>
							<h2><i class="icon-user"></i> Role</h2>
							<div class="box-icon">
								<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
							</div>
						</div>
						<div class="box-content">
							<table class="table table-striped table-bordered bootstrap-datatable datatable">
							  <thead>
								  <tr>
									  <th>Nama Role</th>
									  <th class="center">Actions</th>
								  </tr>
							  </thead>   
							  <tbody>
								<?php $this->load->view('role/role_list'); ?>
							</tbody>
						  </table>            
						</div>
					</div><!--/span-->
			
				</div><!--/row-->
			</div>
			
			<div id="hak-akses-list"></div>
			